Skip to content

Migrate com.sun.xml.bind.marshaller.NamespacePrefixMapper to org.glassfish.jaxb.runtime.marshaller.NamespacePrefixMapper#1121

Merged
Jenson3210 merged 1 commit into
mainfrom
Jenson3210/issue-2462-comment-8
Jun 1, 2026
Merged

Migrate com.sun.xml.bind.marshaller.NamespacePrefixMapper to org.glassfish.jaxb.runtime.marshaller.NamespacePrefixMapper#1121
Jenson3210 merged 1 commit into
mainfrom
Jenson3210/issue-2462-comment-8

Conversation

@Jenson3210
Copy link
Copy Markdown
Contributor

@Jenson3210 Jenson3210 commented May 29, 2026

Summary

  • The JAXB RI relocated com.sun.xml.bind.marshaller.NamespacePrefixMapper to org.glassfish.jaxb.runtime.marshaller.NamespacePrefixMapper as part of the 2.x → 3.x repackaging that accompanies the javax.xml.bindjakarta.xml.bind move. Subclassing NamespacePrefixMapper is a common pattern for controlling XML namespace prefixes during marshalling, and these references were not being rewritten by any existing recipe.

  • Wires a declarative ChangeType into JavaxXmlBindMigrationToJakartaXmlBind (in jakarta-ee-9.yml), placed alongside the existing javax.xml.bindjakarta.xml.bind ChangePackage and com.sun.xml.bind:jaxb-implorg.glassfish.jaxb:jaxb-runtime dependency change, so the type rename rides along with the rest of the Jakarta XML Binding 3.0 wave.

  • ignoreDefinition: true is required since the old type is not on the classpath of the project being migrated; it's referenced via FQN by user code.

  • Addresses item 8 of moderneinc/customer-requests#2462.

Test plan

  • Added migrateNamespacePrefixMapper to JavaxXmlBindMigrationToJakartaXmlBindTest with stubs for both old and new types, asserting the import + extends reference are rewritten on a subclass.
  • ./gradlew test --tests JavaxXmlBindMigrationToJakartaXmlBindTest — BUILD SUCCESSFUL.

…lassfish.jaxb.runtime.marshaller.NamespacePrefixMapper`

The JAXB RI relocated `NamespacePrefixMapper` as part of the 2.x→3.x
repackaging that accompanies the `javax.xml.bind` → `jakarta.xml.bind`
move. Wire a declarative `ChangeType` into
`JavaxXmlBindMigrationToJakartaXmlBind` so subclasses migrate alongside
the rest of the Jakarta XML Binding 3.0 wave.

Refs: moderneinc/customer-requests#2462 (item 8)
@Jenson3210 Jenson3210 requested a review from timtebeek May 29, 2026 21:58
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite May 29, 2026
@Jenson3210 Jenson3210 changed the title Migrate to Migrate com.sun.xml.bind.marshaller.NamespacePrefixMapper to org.glassfish.jaxb.runtime.marshaller.NamespacePrefixMapper May 29, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Ready to Review in OpenRewrite Jun 1, 2026
@Jenson3210 Jenson3210 merged commit fca7c7c into main Jun 1, 2026
1 check passed
@Jenson3210 Jenson3210 deleted the Jenson3210/issue-2462-comment-8 branch June 1, 2026 11:25
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants